// 导入
const joi = require('joi');

const username = joi.string().alphanum().min(3).max(30).required();
const password = joi.string().pattern(/^[\S]{6,30}$/).required();
const emial = joi.string().email().required();
const nickname = joi.string().min(2).max(30).required();
const repassword = joi.ref('password');
// 定义注册验证规则
exports.registerSchema = {
    body:{
        username,
    password,
    repassword
    }
}
// 定义登录验证规则
exports.loginSchema = {
    body:{
        username,
    password
    }
}